<!DOCTYPE HTML>
<html>
<!--_meta 作为公共模版分离出去-->
{include file="common/_meta"}
<!--/meta 作为公共模版分离出去-->
<body>
<!--_header 作为公共模版分离出去-->
{include file="common/_header"}
<!--/_header 作为公共模版分离出去-->
<!--_menu 作为公共模版分离出去-->
{include file="common/_menu"}
<!--/_menu 作为公共模版分离出去-->

<section class="Hui-article-box">
    <nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 	
        <a href="{:url('index/index')}"> 首页</a> <span class="c-gray en">&gt;</span> 
        附件浏览器
        <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a> 
    </nav>
<div class="Hui-article">
<article class="cl pd-20">
    <div class="cl pd-5 bg-1 bk-gray"> <span class="l"> 
        <a href="{:url('filebrowser/upload')}" class="btn btn-primary radius" ><i class="Hui-iconfont">&#xe600;</i> 添加图片</a> </span> 
        <span class="r">共有：<strong>{$counts}</strong> 个对象</span>
    </div>
    <table class="table table-border table-bordered table-bg">
        <thead>
            <tr class="text-c">
                <th width="25%" background="/static/images/linebg.gif"> 
                    <strong>文件名</strong>
                    <!-- &nbsp;&nbsp;<a href=""> [升序]</a>
                    &nbsp;<a href=""> [降序]</a> -->
                </th>
                <th width="16%" background="/static/images/linebg.gif"><strong>文件大小</strong></th>
                <th width="22%" background="/static/images/linebg.gif"><strong>最后修改时间</strong></th>
                <th width="34%"  background="/static/images/linebg.gif"><strong>操作</strong></th>
            </tr>
        </thead>
        <tbody>
            <tr class="text-c"  bgcolor='#FFFFFF' height='26' onMouseMove="javascript:this.bgColor='#FCFDEE';" onMouseOut="javascript:this.bgColor='#FFFFFF';">
                <td>
                <a href="index?activepath={$activeurl}"> <img src=/static/images/dir2.gif border=0 width=16 height=16 align=absmiddle> 上级目录</a></td>
                <td>当前目录:{$activepath} <span style="color:#f00;">  </span> 　</td>
                <td></td>
                <td></td>
            </tr>
            {foreach $dirs as $dir}
            <tr class="text-c" style="height:26px; "  onMouseMove="javascript:this.bgColor='#FCFDEE';" onMouseOut="javascript:this.bgColor='#FFFFFF';">
                <td style="text-align:left;" >
                    <a href="index?activepath={$activepath}/{$dir}"> 
                    <img src=/static/images/dir.gif border=0 width=16 height=16 align=absmiddle>{$dir}
                    </a>
                </td>
                <td>　</td>
                <td>　</td>
                <td>
                    <a href="javascript:; " class="btn">改名</a>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                    <a href="javascript: alert('禁止删除目录')" class="btn">删除</a>
                </td>
            </tr>
            {/foreach}
            {foreach $files as $file}
            <tr class="text-c" bgcolor='#FFFFFF' height='26' onMouseMove="javascript:this.bgColor='#FCFDEE';" onMouseOut="javascript:this.bgColor='#FFFFFF';">
                <td style="text-align:left;" >
                    <a href="/{$activepath}/{$file['name']}"> 
                    <img src="/static/images/{$file['extension']}.gif" border=0 width=16 height=16 align=absmiddle>{$file['name']}
                    </a>
                </td>
                </td>
                <td align='center'> {$file['size']} </td>
                <td align='center'> {$file['time']} </td>
                <td >
                    <a href='javascript:void(0);' onclick="layer_show('查看图片','/{$activepath}/{$file[\'name\']}','600','400')" class="btn" >查看</a>&nbsp;
                    <a href='' class="btn">改名</a>&nbsp;
                    <a href='javascript:void(0);' class="btn" onclick="del(this,'{$activepath}','{$file[\'name\']}')">删除</a>&nbsp;
                    <a href='' class="btn" >移动</a>
                   
                </td>
            </tr>
            {/foreach}
        </tbody>
    </table>
</article>
</div>
</section>
<!--_footer 作为公共模版分离出去-->
{include file="common/_footer" /}
<!--/_footer 作为公共模版分离出去-->


<!--请在下方写此页面业务相关的脚本--> 
<script type="text/javascript">
function del(obj,activepath,filename){
//   alert("test");
//     console.log(obj);
//     console.log(activepath);
//     console.log(filename);
    
//     return false;
    $.ajax({
        type:'POST',
        url:'{:url("filebrowser/del")}',
        data:{'activepath':activepath,'filename':filename},
        cache: false,
        dataType:'json',
        success:function(data){
            if(data.status==1){
                alert("删除成功");
                $(obj).parents('tr').remove();
            }else{
                alert("删除失败");                
                return false;
            }
        },
        error:function(XMLHttpRequest, textStatus, errorThrown){
            alert("提交失败");                
            return false;
        }
    });
}
</script>
<!--请在上方写此页面业务相关的脚本--> 
</body>
</html>
